import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MainComponent } from './components/main/main.component';
import { Index1Component } from './components/index1/index1.component';
import { GowithDetailComponent } from './components/gowith-detail/gowith-detail.component';
import { Index2Component } from './components/index2/index2.component';
import { PublishTravelnoteComponent } from './components/publish-travelnote/publish-travelnote.component';
import { PublishMyGowithComponent } from './components/publish-my-gowith/publish-my-gowith.component';
import { PublishMyTravelnoteComponent } from './components/publish-my-travelnote/publish-my-travelnote.component';
import { SetComponent } from './components/set/set.component';
import { SetUserImgComponent } from './components/set-user-img/set-user-img.component';
import { SetUserMessageComponent } from './components/set-user-message/set-user-message.component';
import { SetUserSafeComponent } from './components/set-user-safe/set-user-safe.component';
import { LoginComponent } from './components/login/login.component';
import { RegistComponent } from './components/regist/regist.component';
import { PublishGowithFormComponent } from './components/publish-gowith-form/publish-gowith-form.component';
import { PublishMyComponent } from './components/publish-my/publish-my.component';


const routes: Routes = [
    {
      path:'',
      component:MainComponent,
      children:[
        {path:'',component:Index1Component},
        {path:'youji',component:Index1Component},
        {path:'jiebanIndex',component:Index2Component},
        {path:'gowithDetail',component:GowithDetailComponent},        
        {path:'writeYouji',component:PublishTravelnoteComponent},
        {path:'publishgowith',component:PublishGowithFormComponent},
        {
          path:'set',
          component:SetComponent,
          children:[
            {path:'',component:SetUserMessageComponent},
            {path:'setUserImg',component:SetUserImgComponent},
            {path:'setUserSafe',component:SetUserSafeComponent},
            {path:'setUserMessage',component:SetUserMessageComponent}
          ]
        },
        {
          path:'publish',
          component:PublishMyComponent,
          children:[
            {path:'',component:PublishMyGowithComponent},
            {path:'publishMG',component:PublishMyGowithComponent},
            {path:'publishMT',component:PublishMyTravelnoteComponent}
          ]
        },
        {path:'publish-gowith',component:PublishMyGowithComponent},
        {path:'publish-travelnote',component:PublishMyTravelnoteComponent},     
      ]
  },
  {path:'regist',component:RegistComponent},
  {path:'login',component:LoginComponent}


];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
